home *** CD-ROM | disk | FTP | other *** search
/ Technotools / Technotools (Chestnut CD-ROM)(1993).ISO / os2tools / bnklysrc / bink.h < prev    next >
Encoding:
C/C++ Source or Header  |  1989-07-08  |  15.6 KB  |  522 lines

  1. /*--------------------------------------------------------------------------*/
  2. /*                                                                            */
  3. /*                                                                            */
  4. /*        ------------         Bit-Bucket Software <no-Inc>                    */
  5. /*        \ 10001101 /         Writers and Distributors of                    */
  6. /*         \ 011110 /          No-Cost<no-tm> Software.                        */
  7. /*          \ 1011 /                                                            */
  8. /*           ------                                                            */
  9. /*                                                                            */
  10. /*    Copyright (C) 1987, 1988, 1989 by Robert Hartman and Vincent Perriello    */
  11. /*                                                                            */
  12. /*                                                                            */
  13. /*                 Major definitions used in BinkleyTerm 2.10                 */
  14. /*                                                                            */
  15. /*                                                                            */
  16. /*      For complete    details  of the licensing restrictions, please refer    */
  17. /*      to the License  agreement,  which  is published in its entirety in    */
  18. /*      the MAKEFILE and BT.C, and also contained in the file LICENSE.210.    */
  19. /*                                                                            */
  20. /*      USE  OF THIS FILE IS SUBJECT TO THE  RESTRICTIONS CONTAINED IN THE    */
  21. /*      BINKLEYTERM  LICENSING  AGREEMENT.  IF YOU DO NOT FIND THE TEXT OF    */
  22. /*      THIS    AGREEMENT IN ANY OF THE  AFOREMENTIONED FILES,    OR IF YOU DO    */
  23. /*      NOT HAVE THESE FILES,  YOU SHOULD  IMMEDIATELY CONTACT THE AUTHORS    */
  24. /*      AT THE  ADDRESSES LISTED BELOW.  IN NO EVENT SHOULD YOU PROCEED TO    */
  25. /*      USE    THIS  FILE    WITHOUT  HAVING   ACCEPTED    THE  TERMS    OF     THE    */
  26. /*      BINKLEYTERM  LICENSING AGREEMENT,  OR SUCH OTHER    AGREEMENT AS YOU    */
  27. /*      ARE ABLE TO REACH WITH THE AUTHORS.                                    */
  28. /*                                                                            */
  29. /*                                                                            */
  30. /*      The Authors can be reached at the following addresses:                */
  31. /*                                                                            */
  32. /*      Robert C. Hartman                      Vincent E. Perriello            */
  33. /*      Spark Software                         VEP Software                    */
  34. /*      427-3 Amherst Street                     111 Carroll Street             */
  35. /*      CS2032, Suite 232                      Naugatuck, CT 06770            */
  36. /*      Nashua, NH 03061                                                        */
  37. /*                                                                            */
  38. /*      FidoNet 1:132/101                      FidoNet 1:141/491                */
  39. /*      Data      (603) 888-8179                 Data     (203) 729-7569         */
  40. /*                                                                            */
  41. /*      Please feel free to contact us at any time to share your comments     */
  42. /*      about our software and/or licensing policies.                         */
  43. /*                                                                            */
  44. /*--------------------------------------------------------------------------*/
  45.  
  46.  
  47. /*--------------------------------------------------------------------------*/
  48. /* LEGIBLE SECTION.  Definitions to make "C" look like a real language.     */
  49. /*--------------------------------------------------------------------------*/
  50.  
  51. #ifndef max
  52. #define max(a,b)     ((a)>(b)?(a):(b))
  53. #endif
  54.  
  55. #ifndef min
  56. #define min(a,b)     ((a)<=(b)?(a):(b))
  57. #endif
  58.  
  59. /*
  60.  * updcrc macro derived from article Copyright (C) 1986 Stephen Satchell.
  61.  *    NOTE: First srgument must be in range 0 to 255.
  62.  *          Second argument is referenced twice.
  63.  *
  64.  * Programmers may incorporate any or all code into their programs,
  65.  * giving proper credit within the source. Publication of the
  66.  * source routines is permitted so long as proper credit is given
  67.  * to Stephen Satchell, Satchell Evaluations and Chuck Forsberg,
  68.  * Omen Technology.
  69.  */
  70.  
  71. #define updcrc(cp, crc) ( crctab[((crc >> 8) & 255) ^ cp] ^ (crc << 8))
  72.  
  73. /* We need it the other way around for BinkleyTerm */
  74. #define xcrc(crc,cp) ( crctab[((crc >> 8) & 255) ^ cp] ^ (crc << 8))
  75.  
  76. typedef unsigned bit;
  77. typedef unsigned int word;
  78. typedef unsigned char byte;
  79.  
  80. #define fallthrough
  81.  
  82.  
  83. #define LOCAL         static
  84. #define empty_str     ""
  85.  
  86. /*PLF Fri  05-05-1989  22:47:12
  87.  *                 struct FILEINFO
  88.  *                 {
  89.  * see find.h        char rsvd[21];
  90.  * and find.c        char attr;
  91.  *                    long time;
  92.  *                    long size;
  93.  *                    char name[13];
  94.  *                    char nill;
  95.  *                 };
  96.  */
  97.  
  98. typedef struct pnums
  99. {
  100.    char num[20];
  101.    char pre[20];
  102.    char suf[20];
  103.    int len;
  104.    struct pnums *next;
  105. } PN_TRNS;
  106.  
  107.  
  108. struct prototable
  109. {
  110.    char first_char;
  111.    int entry;
  112. };
  113.  
  114. typedef struct mail {
  115.    int zone;
  116.    int net;
  117.    int node;
  118.    unsigned int mailtypes;
  119.    struct mail *next;
  120.    struct mail *prev;
  121. } MAIL, *MAILP;
  122.  
  123. /* mailtypes bit field definitions */
  124. #define MAIL_CRASH     0x0001
  125. #define MAIL_HOLD     0x0002
  126. #define MAIL_DIRECT  0x0004
  127. #define MAIL_NORMAL  0x0008
  128. #define MAIL_REQUEST 0x0010
  129. #define MAIL_WILLGO  0x0020
  130. #define MAIL_TRIED     0x0040
  131. #define MAIL_TOOBAD  0x0080
  132. #define MAIL_UNKNOWN 0x0100
  133. #define MAIL_RES0200 0x0200
  134. #define MAIL_RES0400 0x0400
  135. #define MAIL_RES0800 0x0800
  136. #define MAIL_RES1000 0x1000
  137. #define MAIL_RES2000 0x2000
  138. #define MAIL_RES4000 0x4000
  139. #define MAIL_RES8000 0x8000
  140.  
  141. typedef struct finfo
  142. {
  143.    int info_size;
  144.    char curr_fossil;
  145.    char curr_rev;
  146.    char far *id_string;
  147.    int ibufr;
  148.    int ifree;
  149.    int obufr;
  150.    int ofree;
  151.    int swidth;
  152.    int sheight;
  153.    char baud;
  154. } FOSINFO;
  155.  
  156. typedef int (*PFI3) (int, int, int, int);
  157.  
  158. typedef struct {
  159.    unsigned char background;
  160.    unsigned char settings;
  161.    unsigned char history;
  162.    unsigned char hold;
  163.    unsigned char call;
  164.    unsigned char file;
  165. } COLORS, *COLORSP;
  166.  
  167. /*--------------------------------------------------------------------------*/
  168. /* Sealink and Telink header structure                                        */
  169. /*--------------------------------------------------------------------------*/
  170. #define HEADER_NAMESIZE  17
  171.  
  172. struct zero_block
  173. {
  174.    long size;                                     /* file length                    */
  175.    long time;                                     /* file date/time stamp           */
  176.    char name[HEADER_NAMESIZE];                     /* original file name               */
  177.    char moi[15];                                 /* sending program name           */
  178.    char noacks;                                  /* for SLO                        */
  179. };
  180.  
  181.  
  182. /*--------------------------------------------------------------------------*/
  183. /* NodeList.Sys                                                             */
  184. /*                                                                            */
  185. /*      NET > 0 and NODE > 0      Normal node                                    */
  186. /*                                                                            */
  187. /*      NET > 0 and NODE <= 0   Host node                                     */
  188. /*                                 Net host........node== 0                    */
  189. /*                                 Regional host...node==-1                    */
  190. /*                                 Country host....node==-2                    */
  191. /*                                                                            */
  192. /*      NET == -1      Nodelist.Sys revision                                    */
  193. /*                                                                            */
  194. /*      NET == -2      Nodelist statement                                     */
  195. /*                                                                            */
  196. /*--------------------------------------------------------------------------*/
  197.  
  198.  
  199. /*--------------------------------------------------------------------------*/
  200. /* NODE                                                                     */
  201. /* Please note the NewStyle structure (below).    Time is running out for the */
  202. /* existing `_node' structure!  Opus currently uses the old style node      */
  203. /* structure, but not for long.                                             */
  204. /*--------------------------------------------------------------------------*/
  205. struct _node
  206. {
  207.    int number;                                     /* node number                                   */
  208.    int net;                                      /* net number                                      */
  209.    int cost;                                     /* cost of a message to this
  210.                                                   * node                */
  211.    int rate;                                     /* baud rate                                      */
  212.    char name[20];                                 /* node name                                      */
  213.    char phone[40];                                 /* phone number                                  */
  214.    char city[40];                                 /* city and state                                  */
  215. };
  216.  
  217.  
  218. /*--------------------------------------------------------------------------*/
  219. /* THE NEWSTYLE NODE LIST IS NOW BEING USED BY OPUS 1.10                    */
  220. /*--------------------------------------------------------------------------*/
  221. struct _newnode
  222. {
  223.    word NetNumber;
  224.    word NodeNumber;
  225.    word Cost;                                     /* cost to user for a
  226.                                                   * message */
  227.    byte SystemName[34];                          /* node name */
  228.    byte PhoneNumber[40];                         /* phone number */
  229.    byte MiscInfo[30];                             /* city and state */
  230.    byte Password[8];                             /* WARNING: not necessarily
  231.                                                   * null-terminated */
  232.    word RealCost;                                 /* phone company's charge */
  233.    word HubNode;                                 /* node # of this node's hub
  234.                                                   * or 0 if none */
  235.    byte BaudRate;                                 /* baud rate divided by 300 */
  236.    byte ModemType;                                 /* RESERVED for modem type */
  237.    word NodeFlags;                                 /* set of flags (see below) */
  238.    word NodeFiller;
  239. };
  240.  
  241.  
  242. /*------------------------------------------------------------------------*/
  243. /* Values for the `NodeFlags' field                                       */
  244. /*------------------------------------------------------------------------*/
  245. #define B_hub       0x0001
  246. #define B_host       0x0002
  247. #define B_region   0x0004
  248. #define B_zone       0x0008
  249. #define B_CM       0x0010
  250. #define B_ores1    0x0020
  251. #define B_ores2    0x0040
  252. #define B_ores3    0x0080
  253. #define B_ores4    0x0100
  254. #define B_ores5    0x0200
  255. #define B_res1       0x0400
  256. #define B_res2       0x0800
  257. #define B_res3       0x1000
  258. #define B_res4       0x2000
  259. #define B_res5       0x4000
  260. #define B_res6       0x8000
  261.  
  262.  
  263.  
  264. /*--------------------------------------------------------------------------*/
  265. /* Nodelist.Idx                                                             */
  266. /* (File is terminated by EOF)                                                */
  267. /*--------------------------------------------------------------------------*/
  268.  
  269. struct _ndi
  270. {
  271.    int node;                                     /* node number  */
  272.    int net;                                      /* net number     */
  273. };
  274.  
  275.  
  276. /*--------------------------------------------------------------------------*/
  277. /* QuickBBS 2.00 QNL_IDX.BBS                                                */
  278. /* (File is terminated by EOF)                                                */
  279. /*--------------------------------------------------------------------------*/
  280.  
  281. struct QuickNodeIdxRecord
  282. {
  283.    int QI_Zone;
  284.    int QI_Net;
  285.    int QI_Node;
  286.    byte QI_NodeType;
  287. };
  288.  
  289.  
  290. /*--------------------------------------------------------------------------*/
  291. /* QuickBBS 2.00 QNL_DAT.BBS                                                */
  292. /* (File is terminated by EOF)                                                */
  293. /*--------------------------------------------------------------------------*/
  294.  
  295. struct QuickNodeListRecord
  296. {
  297.    byte QL_NodeType;
  298.    int QL_Zone;
  299.    int QL_Net;
  300.    int QL_Node;
  301.    byte QL_Name[21];                             /* Pascal! 1 byte count, up
  302.                                                   * to 20 chars */
  303.    byte QL_City[41];                             /* 1 + 40 */
  304.    byte QL_Phone[41];                             /* 1 + 40 */
  305.    byte QL_Password[9];                          /* 1 + 8 */
  306.    word QL_Flags;                                 /* Same as flags in new
  307.                                                   * nodelist structure */
  308.    int QL_BaudRate;
  309.    int QL_Cost;
  310. };
  311.  
  312.  
  313. /* SEAdog NETLIST.DOG format */
  314. struct netls
  315. {
  316.    int netnum;
  317.    char netname[14];
  318.    char netcity[40];
  319.    int havehost;
  320.    int nethost;
  321.    int havegate;
  322.    int netgate;
  323.    long nodeptr;
  324.    int numnodes;
  325. };
  326.  
  327. /* SEAdog NODELIST.DOG format */
  328. struct nodels
  329. {
  330.    int nodenum;
  331.    char nodename[14];
  332.    char nodecity[40];
  333.    char nodephone[40];
  334.    int havehub;
  335.    int nodehub;
  336.    int nodecost;
  337.    int nodebaud;
  338. };
  339.  
  340. /* Things most nodelists don't contain, but Binkley likes to have */
  341. struct extrastuff
  342. {
  343.    char password[8];
  344.    unsigned int flags1;
  345.    char extra[6];                                 /* for future expansion */
  346. };
  347.  
  348.  
  349. /*--------------------------------------------------------------------------*/
  350. /* FIDONET ADDRESS STRUCTURE                                                */
  351. /*--------------------------------------------------------------------------*/
  352. typedef struct _ADDRESS
  353. {
  354.    word  Zone;
  355.    word  Net;
  356.    word  Node;
  357.    word  Point;
  358. } ADDR;
  359.  
  360.  
  361. #define  MAX_EXTERN         8
  362. #define  ALIAS_CNT           15
  363.  
  364. /*--------------------------------------------------------------------------*/
  365. /* Matrix mask                                                                */
  366. /* Undefined bits are reserved by Opus                                        */
  367. /*--------------------------------------------------------------------------*/
  368. #define NO_TRAFFIC 0x0001
  369. #define LOCAL_ONLY 0x0002
  370. #define OPUS_ONLY  0x0004
  371.  
  372. #define NO_EXITS   0x2000
  373. #define MAIL_ONLY  0x4000
  374. #define TAKE_REQ   0x8000
  375.  
  376.  
  377. /*--------------------------------------------------------------------------*/
  378. /* Message packet header                                                    */
  379. /*--------------------------------------------------------------------------*/
  380.  
  381. #define PKTVER         2
  382.  
  383.  /*--------------------------------------------*/
  384.  /* POSSIBLE VALUES FOR `product' (below)      */
  385.  /* */
  386.  /* NOTE: These product codes are assigned by  */
  387.  /* the FidoNet<tm> Technical Stardards Com-   */
  388.  /* mittee.  If you are writing a program that */
  389.  /* builds packets, you will need a product    */
  390.  /* code.  Please use ZERO until you get your  */
  391.  /* own.  For more information on codes, write */
  392.  /* to FTSC at 220/1.                           */
  393.  /* */
  394.  /*--------------------------------------------*/
  395. #define isFIDO         0
  396. #define isSPARK      1
  397. #define isSEA         2
  398. #define isDIRE         3
  399. #define isSlick      4
  400. #define isOPUS         5
  401. #define isHENK         6
  402. #define isTABBIE     8
  403. #define isWOLF         10
  404. #define isQMM         11
  405. #define isFD         12
  406. #define isTERUS      13
  407. #define isCYGNUS     16
  408. #define isGSPOINT     19
  409. #define isBGMAIL     20
  410. #define isCROSSBOW     21
  411. #define isDBRIDGE     26
  412. #define isDAISY      30
  413. #define isTHEBOX     32
  414.  
  415.  
  416. struct _pkthdr
  417. {
  418.         int orig_node;            /* originating node               */
  419.         int dest_node;            /* destination node               */
  420.         int year;                /* 0..99  when packet was created */
  421.         int month;                /* 0..11  when packet was created */
  422.         int day;                /* 1..31  when packet was created */
  423.         int hour;                /* 0..23  when packet was created */
  424.         int minute;             /* 0..59  when packet was created */
  425.         int second;             /* 0..59  when packet was created */
  426.         int rate;                /* destination's baud rate        */
  427.         int ver;                /* packet version                  */
  428.         int orig_net;            /* originating network number      */
  429.         int dest_net;            /* destination network number      */
  430.         char product;            /* product type                   */
  431.         char serial;            /* serial number (some systems)   */
  432.  
  433.    /* ------------------------------ */
  434.    /* THE FOLLOWING SECTION IS NOT     */
  435.    /* THE SAME ACROSS SYSTEM LINES:  */
  436.    /* ------------------------------ */
  437.  
  438.         byte password[8];        /* session/pickup password          */
  439.         int  orig_zone;         /* originating zone               */
  440.         int  dest_zone;         /* Destination zone               */
  441.         byte B_fill2[16];
  442.         long B_fill3;
  443. };
  444.  
  445.  
  446.  
  447.  
  448. /*--------------------------------------------------------------------------*/
  449. /* WaZOO                                                                    */
  450. /*--------------------------------------------------------------------------*/
  451.  
  452. #ifdef WAZOO_SECTION
  453.  
  454. #ifndef ACK
  455. #define ACK    0x06
  456. #endif
  457.  
  458. #ifndef NAK
  459. #define NAK    0x15
  460. #endif
  461.  
  462. #ifndef ENQ
  463. #define ENQ    0x05
  464. #endif
  465.  
  466. #ifndef YOOHOO
  467. #define YOOHOO 0x00f1
  468. #endif
  469.  
  470. #ifndef  TSYNC
  471. #define  TSYNC 0x00ae
  472. #endif
  473.  
  474. struct _Hello
  475. {
  476.    word signal;                                  /* always 'o'     (0x6f)                   */
  477.    word hello_version;                             /* currently 1    (0x01)                    */
  478.    word product;                                 /* product code                            */
  479.    word product_maj;                             /* major revision of the
  480.                                                   * product           */
  481.    word product_min;                             /* minor revision of the
  482.                                                   * product           */
  483.    char my_name[60];                             /* Other end's name                        */
  484.    char sysop[20];                                 /* sysop's name                            */
  485.    word my_zone;                                 /* 0== not supported                        */
  486.    word my_net;                                  /* out primary net number                    */
  487.    word my_node;                                 /* our primary node number                 */
  488.    word my_point;                                 /* 0== not supported                        */
  489.    byte my_password[8];                          /* ONLY 6 CHARACTERS ARE
  490.                                                   * SIGNIFICANT !!!!! */
  491.    byte reserved2[8];                             /* reserved by Opus                        */
  492.    word capabilities;                             /* see below                                */
  493.    byte reserved3[12];                             /* available to non-Opus
  494.                                                   * systems by prior                        */
  495.                                                  /* "approval" of 124/108.                  */
  496. };                                                 /* size 128 bytes */
  497.  
  498.  
  499. /*--------------------------------------------------------------------------*/
  500. /* YOOHOO<tm> CAPABILITY VALUES                                             */
  501. /*--------------------------------------------------------------------------*/
  502. #define Y_DIETIFNA 0x0001
  503. #define FTB_USER   0x0002
  504. #define Bit_2       0x0004
  505. #define ZED_ZAPPER 0x0008
  506. #define DOES_IANUS 0x0010
  507. #define Bit_5       0x0020
  508. #define Bit_6       0x0040
  509. #define Bit_7       0x0080
  510. #define Bit_8       0x0100
  511. #define Bit_9       0x0200
  512. #define Bit_a       0x0400
  513. #define Bit_b       0x0800
  514. #define Bit_c       0x1000
  515. #define Bit_d       0x2000
  516. #define Bit_e       0x4000
  517. #define WZ_FREQ    0x8000
  518.  
  519. #endif
  520.  
  521. /* END OF FILE: bink.h */
  522.